const env = process.env.NODE_ENV;
// console.log('==========================')
// console.log('环境===', env)
// console.log('==========================')

// 开发环境数据库配置
const devConfig = {

    //测试环境数据库
    // dbName: 'kartu_uang_market_test',
    // dbPass: 'c49ad3a6085b27f1',
    // dbHost: '110.43.37.166',
    // dbUser: 'root',
   
     //测试
    dbName: 'kartu_uang_market_test',
    dbPass: '1qaz@WSX',
    dbHost: 'rm-uf6e44npwucqc06ipuo.mysql.rds.aliyuncs.com',
    dbUser: 'market_3',


    //生产环境数据库
    // dbName: 'kartu_uang_market_default',
    // dbPass: '1qaz@WSX',
    // dbHost: 'rm-k1axa99f8a296sxj3uo.mysql.ap-southeast-5.rds.aliyuncs.com',
    // dbUser: 'market_3',
    dbPort: 3306,
    timezone: '08:00',  // 处理使用node查询数据库（mysql）时，日期格式不对的问题
    host: 'http://localhost',
    appname:'kreditbailu',
    appId:'',
    appSecret:'',
    smsurl:'http://intapi.253.com/send/json',
    smsuid:'I6313616',
    smspwd:'SZDD2017',
    port: 3001,  //端口号
    ADMIN_PREFIX: '_?:L$"OPUIOSIFJ(*UPT:LKRFG',  // 密码加密前缀
    appversion:'1.0.0',
    applng:'ind',//app语言
    //fileurl:'http://media-cash-market-vn.oss-cn-shanghai.aliyuncs.com/media/', //生产环境图片路径
    fileurl:'https://market-v3-in.oss-ap-southeast-5.aliyuncs.com/',//测试环境图片路径
    productimgurl:'http://media-cash-market-vn.oss-cn-shanghai.aliyuncs.com/media/',//产品图片路径
    bucket:'market-v3-in',
    country_id:1,
    osstokenapi:'http://market.test.janesi.cn/api/v1/upload/photos/token?type=1',//获取osstoken
    faceapi:'http://market.test.janesi.cn/loan/app/face_verify_v3/'//活体检测

}
// 线上环境数据库配置
const protConfig = {
    // dbName: 'kartu_uang_market_test',
    // dbPass: 'c49ad3a6085b27f1',
    // dbHost: '110.43.37.166',
    // dbUser: 'root',
    //线上
    // dbName: 'kartu_uang_market_default',
    // dbPass: '1qaz@WSX',
    // dbHost: 'rm-k1axa99f8a296sxj3uo.mysql.ap-southeast-5.rds.aliyuncs.com',
    // dbUser: 'market_3',
    //测试
    dbName: 'kartu_uang_market_test',
    dbPass: '1qaz@WSX',
    dbHost: 'rm-uf6e44npwucqc06ipuo.mysql.rds.aliyuncs.com',
    dbUser: 'market_3',


    dbPort: 3306,
    timezone: '08:00',
    host: 'http://localhost',
    appname:'kreditbailu',
    appId:'',
    appSecret:'',
    smsurl:'http://intapi.253.com/send/json',
    smsuid:'I6313616',
    smspwd:'SZDD2017',
    port: 3001,  //端口号
    ADMIN_PREFIX: '_?:L$"OPUIOSIFJ(*UPT:LKRFG',  // 密码加密前缀
    appversion:'1.0.0',
    applng:'ind',//app语言
    //fileurl:'http://market-v3-in.oss-ap-southeast-5.aliyuncs.com/',//生产h环境图片路径
    //productimgurl:'http://media-cash-market-in.oss-ap-southeast-5.aliyuncs.com/media/',//生产环境产品图片路径

    fileurl:'https://market-v3-in.oss-ap-southeast-5.aliyuncs.com/',//测试环境图片路径
    productimgurl:'http://media-cash-market-vn.oss-cn-shanghai.aliyuncs.com/media/',//产品图片路径
    bucket:'market-v3-in',
    country_id:1,
   
    //osstokenapi:'https://www.uongcepat.com/api/v1/upload/photos/token?type=1',//获取osstoken
    //faceapi:'https://www.uongcepat.com/loan/app/face_verify_v3/'//活体检测

    osstokenapi:'http://market.test.janesi.cn/api/v1/upload/photos/token?type=1',//获取osstoken
    faceapi:'http://market.test.janesi.cn/loan/app/face_verify_v3/'//活体检测

}


// setconfig=()=>{
//     let config = {}
//     if (env === 'development') {
//         config = devConfig;
//         console.log('当前开发环境');
//     } else if (env === 'production') {
//         config = protConfig;
//         console.log('当前生产环境');
//     }
//     return config;
// }
module.exports = {
    'devConfig': devConfig,
    'protConfig': protConfig
}